<?php
/*
    Copyright (C) 2008 - 2010 Inanta Martsanto
    
    This file is part of Koma.

    Koma is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Koma is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Koma.  If not, see <http://www.gnu.org/licenses/>.
    
    Inanta Martsanto (inanta@inationsoft.com)
*/
if(!defined('KOMA_LOCALE')) define('KOMA_LOCALE', isset($_GET['locale']) ? $_GET['locale'] : KOMA_DEFAULT_LOCALE);
if(!defined('KOMA_LOCALE_PATH')) define('KOMA_LOCALE_PATH', KOMA_ROOT_PATH.'/locales');

if(function_exists('gettext_init')) gettext_init($locale = KOMA_LOCALE, $domain = 'exception', $locale_dir = KOMA_LOCALE_PATH, $encoding = 'UTF-8');

class KomaException extends Exception
{
	function __construct($message = 'Koma unknown error')
	{
		parent::__construct(htmlentities(str_replace(KOMA_ROOT_PATH.'/', '', T_($message))));
	}
}
?>